#pragma once
#include <list>
#include "CLComString.h"
#include "irecordower.h"
#include "CLComLibrarys_global.h"
//CLCOMLIBRARYS_EXPORT

struct CLCOMLIBRARYS_EXPORT SRecordInfo
{
    int                         _nOPIndex;
	ERECORD_DATA_OPERATE_TYPE	_eOPType;
    ERECORD_DATATYPE            _eDataType;
    CLComString					_opIDS;
    CLComString					_opDesc;

	SRecordInfo()
	{
		_nOPIndex = 0;
		_eOPType = ERECORD_DATA_OPERATE_TYPE_SHOW;
		_eDataType = ERECORD_DATATYPE_SHOW;
		_opIDS = "";
		_opDesc = "";
	}
	void Copy(const SRecordInfo& other)
	{
		_nOPIndex = other._nOPIndex;
		_eOPType = other._eOPType;
		_eDataType = other._eDataType;
		_opIDS = other._opIDS;
		_opDesc = other._opDesc;
	}
	SRecordInfo(const SRecordInfo& other)
	{
		Copy(other);
	}
	SRecordInfo& operator=(const SRecordInfo& other)
	{
		Copy(other);
		return *this;
	}
};

typedef void(*PCHANGECALLBACK)(SRecordInfo& record);

class CLCOMLIBRARYS_EXPORT CLComRecord
{
public:
    static CLComRecord* CreateRecord(CLComString programid, IRecordOwer* ppRogram);
    static CLComRecord* GetInstance(CLComString programid);
    static void ReleaseInstance(CLComString programid);
public:
	virtual void Clear() = 0;
public:
	virtual void StartNewSerial() = 0;
public:
	virtual void SetChangeCallback(PCHANGECALLBACK pcallback) = 0;
public:
	virtual void GetRecords(list<SRecordInfo>& vecBackList,
		SRecordInfo& currentrecord,
		list<SRecordInfo>& nextList) = 0;
public:
	virtual void UnableRecord() = 0;
	virtual void EnableRecord() = 0;
public:
	virtual void RecordData(ERECORD_DATA_OPERATE_TYPE otype, ERECORD_DATATYPE dType, 
        CLComString opdesc, CLComString id) = 0;
public:
	virtual bool GoBack(int recordID = -1) = 0;
	virtual bool GoNext(int recordID = -1) = 0;

public:
	virtual bool HaveNext() = 0;
	virtual bool HaveBack() = 0;
	virtual bool HaveChange() = 0;
};

